package D2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-05-16
 * Time: 11:36
 */

public class Pillar {
        private double height;
        private Geometry bottom;
        public double getVolume(){
            return bottom.getArea()*height;
        }

        public void setHeight(double height) {
            this.height = height;
        }

        public void setBottom(Geometry bottom) {
            this.bottom = bottom;
        }

        public double getHeight() {
            return height;
        }

        public Geometry getBottom() {
            return bottom;
        }

        public Pillar(double height, Geometry bottom) {
            this.height = height;
            this.bottom = bottom;
        }
        public Pillar(int height, Circle c1){
        }

        @Override
        public String toString() {
            return "底:"+bottom.toString()+"，底面积是"+bottom.getArea()+"，柱体的高是"+height+"，柱体的面积是"+getVolume();
        }
    }


